//
//  BasicCalculatorView.h
//  iCalculator
//
//  Created by Stephen Houser on 9/9/07.
//  Copyright 2007 __MyCompanyName__. All rights reserved.
//

#import "CalculatorApp.h"
#import "CalculatorEngine.h"
#import "BasicKeypad.h"

@interface BasicCalculatorView : UIView {
	// string that we collect digits and decimals in
	// hopefully it is a number :-)
	NSMutableString * display;
	
	// should the display be reset on the next digit or
	// decimal entered? This is set after we hit an operator
	// so that the display shows our entry until we hit another
	// digit. Just like a real calculator.
	BOOL resetDisplay;

	// The calculator's display 
	UITextView * resultDisplay;
	// The keypad
	UIImageView * keypad;
	
	// The thing that controls us... where we send commands
	CalculatorApp * controller;
	// The calculation engine... where we get results from
	CalculatorEngine * engine;
}

- (id) initWithFrame: (CGRect) frame 
	withController:(CalculatorApp *) controller 
	withEngine: (CalculatorEngine *) engine
	withType: (int) calcType;
	
- (void) updateView;
- (void) handleCommand: (NSString *) command;
@end
